Release 10.1A: OpenEdge Data Management:
SQL Reference
BEGIN-END DECLARE SECTION
Declares variables and types used by the precompiler. Any variables you refer to in an embedded SQL statement must be declared in a
DECLARE SECTION. This section starts with aBEGIN DECLARE SECTIONstatement and ends with anEND DECLARE SECTIONstatement. Each variable must be declared as a host language data type.Syntax
host_lang_type variable_name ;
A conventional C language variable declaration. This form of variable declaration conforms to the ANSI standard for the C language.
Example
Notes
- The C language type int is not supported by ESQL. Type int maps to 16 or 32 bits, depending on the machine architecture. This can create rounding errors at run time, as values are passed across different machine architectures.
- Variables you declare in a
BEGIN-END DECLARE SECTIONcan be used in C language statements as if they are declared outside theDECLARE SECTION.- The scope of variables follows host language scoping rules. The ESQL variables are not visible outside the file in which they are declared.
DECLAREsections are permissible only where host language declarations are permissible in the host language syntax. This restriction is due to howDECLARE SECTIONblocks are translated into the main body of host language declarations.- Avoid
DECLAREsections in header files that are included by more than one source file. This can cause duplicate variables with the same name.- The form of the variable created by ESQL for each type is specified so that it can be manipulated from host language statements. Declaring variables allows you to use the variables in both host language and embedded SQL statements.
Authorization
None
Related statements
Static Array Types
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |